import api from "@/api";
import axios from "@/utils/axios";

export default {
    getHospitalList,
    addHospital,
    showHospitalMessage,
    updateHospitalMessage,
    deleteHospital,
    searchHospitalList,
    addOffice,
    updateOffice
}
//修改科室信息
function updateOffice(updateOfficeForm) {
    return axios({
        url: api.hospitalApi.updateOffice,
        method: 'post',
        data: updateOfficeForm
    })
}
//添加科室信息
function addOffice(addOfficeForm) {
    return axios({
        url: api.hospitalApi.addOffice,
        method: 'post',
        data: addOfficeForm
    })
}
//模糊查询
function searchHospitalList(address, aliss, estate, name, regTime) {
    return axios({
        url: api.hospitalApi.searchHospitalList,
        method: 'post',
        params: { address, aliss, estate, name, regTime }
    })
}

//删除医院
function deleteHospital(id) {
    return axios({
        url: api.hospitalApi.deleteHospital,
        method: 'post',
        params: { id }
    })
}

//编辑医院信息
function updateHospitalMessage(hospital) {
    return axios({
        url: api.hospitalApi.updateHospitalMessage,
        method: 'post',
        data: hospital
    })
}

//查看医院基本信息
function showHospitalMessage(id) {
    return axios({
        url: api.hospitalApi.showHospitalMessage,
        method: 'post',
        params: { id }
    })
}

//添加医院
function addHospital(address,aliss,contact,estate,helpline,hosName,hosPhone,nature,telephone) {
    return axios({
        url: api.hospitalApi.addHospital,
        method: 'get',
        params: {address,aliss,contact,estate,helpline,hosName,hosPhone,nature,telephone},
    })
}

//获取医院列表
function getHospitalList(page, size) {
    return axios({
        url: api.hospitalApi.getHospitalList,
        method: 'post',
        data: {
            page,
            size
        }
    })
}